<!DOCTYPE html>
<html>
<!--
Copyright 2011 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
-->
<head>
  <meta charset="utf-8" />
  <link rel="stylesheet" type="text/css" href="css/fpstest.css"/>
  <script type="text/javascript" src="alltests.js"></script>
</head>
  <body>
    <h2>Environment Performance Tests</h2>
    <ol id="tests"></ol>
    <div id="all-tests"><a tabindex="100" href="all_tests.html">
        All Tests</a></div>
  </body>
  <script type="text/javascript" src="examples.js"></script>
  <script>

    // Prevent the test runner from automatically running:
    goog.testing.TestRunner.prototype.execute = function() {};

    function createTestLink(test, index) {
      var anchor = goog.dom.createElement('a');
      var props = { tabindex: (index+1), href: test };
      goog.dom.setProperties(anchor, props);
      var anchorText = goog.dom.createTextNode(test);
      goog.dom.append(anchor, anchorText);

      var listItem = goog.dom.createElement('li');
      goog.dom.append(listItem, anchor);
      return listItem;
    }

    function createTestLinks(allTests) {
      if (_allTests) {
        var container = goog.dom.$('tests');
        _allTests.forEach(function(test, index) {
          goog.dom.append(container, createTestLink(test, index));
        });
      }
    }

    function displayUserAgent() {
      var div = goog.dom.createElement('div');
      var props = { 'class': 'user-agent' };
      goog.dom.setProperties(div, props);
      goog.dom.append(div, navigator.userAgent);
      goog.dom.append(document.body, div);
    }

    createTestLinks(_allTests); // loaded from alltests.js
    displayUserAgent();
    testing.KeyNav('a');

  </script>
</html>
